package com.hd.openapi.servies.serviceimpl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hd.openapi.common.ResponseResult;
import com.hd.openapi.common.ResultTable;
import com.hd.openapi.dao.AppInfoMapper;
import com.hd.openapi.entity.AppInfo;
import com.hd.openapi.servies.infoser;
import com.sun.xml.internal.bind.v2.schemagen.xmlschema.Appinfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class infoserIMPL implements infoser {
    @Autowired
    private AppInfoMapper app;
    @Override
    public ResultTable getdata(Integer page, Integer limit, String corpName) {
        PageHelper.startPage (page,limit);
        List<Appinfo> a=app.getalldata(corpName);
        PageInfo aa=new PageInfo (a);
        return new ResultTable (0,"",(int)aa.getTotal (),aa.getList ());
    }

    @Override
    public ResponseResult updateda(AppInfo appInfo) {
        int i = app.updateByPrimaryKeySelective (appInfo);
        return ResponseResult.getSuccess ();
    }

    @Override
    public ResponseResult addtata(AppInfo appInfo) {
        int i = app.insertSelective (appInfo);
        return ResponseResult.getSuccess ();
    }

    @Override
    public ResponseResult del(Integer[] ids) {
        return null;
    }
}
